package telebasesimple;

import java.util.ArrayList;

public class Contact {

    public class Phone {

        private Integer k;
        private String phone;

        public Phone(Integer k, String phone) {
            this.k = k;
            this.phone = phone;
        }

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        @Override
        public String toString() {
            return this.phone;
        }
    }
    private Integer p_id;
    private String Name;
    private String Job;
    private ArrayList<Phone> Phones = new ArrayList<Phone>();

    public Contact(Integer p_id, String Name, String Job) {
        this.p_id = p_id;
        this.Name = Name;
        this.Job = Job;
    }

    public void addPhone(Integer k, String phone) {
        this.Phones.add(new Phone(k, phone));
    }

    public Integer getP_id() {
        return p_id;
    }

    public String getJob() {
        return Job;
    }

    public String getName() {
        return Name;
    }

    public String getPhonesString() {
        String phones = "";
        for (Phone phoneo : this.Phones) {
            phones += phoneo.getPhone() + "   ";
        }
        return phones;
    }

    public ArrayList<Phone> getPhones() {
        return Phones;
    }

    @Override
    public String toString() {
        return this.Name;
    }
}
